//
//  MeCommonJumpCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/6.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "MeCommonJumpCell.h"

@interface MeCommonJumpCell ()
@property (weak, nonatomic) IBOutlet UILabel *leftLabel;
@property (weak, nonatomic) IBOutlet UILabel *rightLabel;
@property (weak, nonatomic) IBOutlet UIImageView *leftImageView;

@end

@implementation MeCommonJumpCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    self.leftLabel.font = MYFONT(15);
    
    self.rightLabel.font = MYFONT(13);
    
    self.rightLabel.textColor = darkGray;
    // Initialization code
}
- (void)setIndex:(NSIndexPath *)index{
    _index = index;
    self.rightLabel.hidden = NO;
    
    self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    if (index.section == 0) {
        
        if (myViewModel.hideShopping) {
            
            self.leftLabel.text = @"";
            self.rightLabel.text = @"";
            self.leftImageView.image = [UIImage imageWithMyColor:[UIColor clearColor]];
           self.accessoryType = UITableViewCellAccessoryNone;
        } else {
            self.leftLabel.text = @"我的订单";
            self.rightLabel.text = @"查看全部订单";
            self.leftImageView.image = [UIImage imageNamed:@"myCenter0001"];
  
            self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

          

        }
        
       

        
    } else if (index.section == 1){
        
        self.leftImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"myCenter00%ld",_index.row]];
        
        if (index.row == 0) {
            
            self.leftLabel.text = @"账户余额";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
     
        } else if (index.row == 1){
            
            self.leftLabel.text = @"充值记录";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
            
        }else if (index.row == 2){
            
            self.leftLabel.text = @"电费记录";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;

        }else if (index.row == 3){
            
            
            self.leftLabel.text = @"网费记录";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
            
           
            
        }else if (index.row == 4){
            
            
            self.leftLabel.text = @"我的房源信息";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
           
            
        }else if (index.row == 5){
            
            self.leftLabel.text = @"地址管理";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
            
           
        }else if (index.row == 6){
            
            if (myViewModel.userIsLogin) {
                
                self.leftLabel.text = @"退出登录";

            } else {
                
                self.leftLabel.text = @"点击登录";

            }
            
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
        }
        
    }else{
        
        if (index.row == 0) {
            
            self.leftLabel.text = @"在线客服";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
            
        } else if (index.row == 1) {
            
            self.leftLabel.text = @"意见反馈";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
            
        }else{
            
            self.leftLabel.text = @"关于我们";
            self.rightLabel.text = nil;
            self.rightLabel.hidden = YES;
            
        }
        
    }
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
